#ifndef _xParameterPack_H_
#define	_xParameterPack_H_
/*------------------------------------------------------------
  2008/5/18 By YPC
   xMappingNode is of the new mapping node design (please see design document)
   There is no more VVnode and WVnode in this new design.
   "x" means X-man mapping node.
   a xMappingNode can accept abitrary kinds of connections 
   (from WOPs, VMs, collectors, or arithmetic operator
  --------------------------------------------------------------
*/
#include <vector>
#include <string>
#include "WOP_Entry.h"
#include "OgreQuaternion.h"

const std::string T_array[] = { "varname", "tostring*",
                              "bool", "int", "char", "float", "double", "string",
							  "bool*", "int*", "char*", "float*", "double*", "string*",
							  "wop", "wops", "vm", "vms", "ints", "Quaternion*" };
const int T_array_len  = 20 ;
const std::string T_VARNAME = "varname" ;
const std::string T_BOOL = "bool";
const std::string T_INT  = "int" ;
const std::string T_CHAR = "char";
const std::string T_DOUBLE = "double" ;
const std::string T_FLOAT = "float" ;
const std::string T_STRING = "string" ;

const std::string TP_BOOL = "bool*";
const std::string TP_INT  = "int*" ;
const std::string TP_CHAR = "char*";
const std::string TP_DOUBLE = "double*" ;
const std::string TP_FLOAT = "float*" ;
const std::string TP_STRING = "string*" ;
const std::string TP_TOSTRING = "tostring*" ;
const std::string TP_QUATERNION = "Quaternion*" ;

const std::string T_INTS = "ints" ;
const std::string T_WOP = "wop" ;
const std::string T_WOPS = "wops" ;

const std::string T_VM = "vm" ;
const std::string T_VMS = "vms" ;

class xNodeType ;

class xParameter {
public:
	xParameter();

	std::string type;
	//string original ; // the original string stored
	union {
		bool val_bool ;  // get the boolean value
		int val_int  ;
		char val_char ;
		double val_double ;
		float val_float ;
	
		bool* val_bool_ptr ; // pointer to a boolean variable
		int* val_int_ptr  ;
		char* val_char_ptr ;
		double* val_double_ptr ;
		float* val_float_ptr ; 	
	};	
	vector<int> val_ints ;
	Ogre::Quaternion* val_quaternion_ptr ;
	Ogre::Degree* val_degree_ptr;
	string val_string ;
	string* val_string_ptr ;
	WOP_Entry *val_wop ; // pointer to a wop entry
	xNodeType* wop_nodetype ;
	vector<WOP_Entry *> val_wops ;	// 

	DIVA_VM *val_vm ;
	vector<DIVA_VM*>  val_vms ;
};

class xParameterPack {
public:
	int no ; // number of parameters
	vector<xParameter> paras ;
	vector<bool> para_onoff ;
};

#endif
